package com.sunlands.zlcx.usercenter.vo;
@SuppressWarnings("all")
public enum CommonResultMessage {

    SUCCESS(0L, "success","OK"),

    UNKOWN_ERROR(-1L, "系统内部错误,请稍后重试", "系统内部错误,请稍后重试"),

    PARAMS_NOT_NULL(11000L, "参数不能为空", "参数不能为空"),
    PARAMS_NOT_INVALIDE(11002L, "参数值无效", "参数值无效"),
    PASSWORD_ERROR(11003L, "用户名/密码错误", "用户名/密码错误"),
    INVALID_USER(11004L, "无效用户", "无效用户"),
    INVALID_ID(11005L, "无效id", "无效id"),
    PHONE_EXIST(11006L, "手机号码已注册", "手机号码已注册"),
    PHONE_HAS_BINDING_TO_THIS_USER(11026L, "手机号码已经绑定到该用户", "手机号码已经绑定到该用户"),
    NO_AUTH(10401L, "没有权限访问", "没有权限访问"),
    LOGIN_LIMIT(10402L, "您的账号因严重违反社区规定，已被限制登录", "您的账号因严重违反社区规定，已被限制登录"),
    VERIFY_CODE_ERROR(11007L, "验证码错误", "验证码错误"),
    VERIFY_CODE_SEND_ERROR(11008L, "验证码发送错误", "验证码发送错误"),
    VERIFY_CODE_SEND_FREQUENCY(11009L, "验证码发送频繁", "验证码发送频繁"),
    VERIFY_CODE_VERIFY_FREQUENCY(11010L, "验证码校验频繁", "验证码校验频繁"),
    MP_LOGIN_CODE_ERROR(10700L, "微信登录异常", "微信登录异常"),
    LOGIN_CODE_ERROR(10701L, "登录异常", "登录异常"),
    FILE_SIZE_LIMIT(10801L, "文件大小不符合要求", "文件大小不符合要求"),
    FILE_TYPE_LIMIT(10802L, "文件类型不符合要求", "文件类型不符合要求"),
    USERSSTUDYINFO_NULL(11010L,"用户学习生活VO不能为空", "用户学习生活VO不能为空"),
    USERSTARGETRELATIONDO_NULL(11011L,"学习目标不能为空", "学习目标不能为空"),
    USER_NOT_LEARNING(11012L, "用户没有在学习中", "用户计时学习中"),

    USER_TIME_LEARNING(21014L, "您正在专注计时", "您正在专注计时"),
    USER_LIVE_LEARNING(21015L, "您正在连麦计时", "您正在连麦计时"),
    TIME_LEARN_ROOM_LEARNING(29505L, "您正在自习室计时", "您正在自习室计时"),

    DEL_TARGET_ERROR(11013L,"正在学习中不能删除目标，请结束学习后再试", "正在学习中不能删除目标，请结束学习后再试"),
    IMAGE_VIOLATION(14001L, "头像内容可能包含违规内容，请更换后再发表", ""),
    INVITE_CODE_NO_VALID(15001L, "邀请码失效", "邀请码失效"),
    USED_INVITE_CODE(15002L, "已使用过邀请码", "已使用过邀请码"),
    NO_NEW_USER(15003L, "您已经是老用户了，快去连麦学习吧~", "您已经是老用户了，快去连麦学习吧~"),

    LEARN_CONTENT_EXIST(15100L, "学习内容不存在", "学习内容不存在"),
    LEARN_CONTENT_REPEAT(15101L, "当前学习内容已存在，请重新检查", "当前学习内容已存在，请重新检查"),
    LEARN_CONTENT_COUNT_LIMIT(15102L, "当前计时任务已达到40条上限", "当前计时任务已达到40条上限"),
    LEARN_NO_END(15103L, "由于提前关闭app，本次计时已自动结束！", "由于提前关闭app，本次计时已自动结束！"),

    STATUS_HANDLER_ERROR(25000L, "没有找到对应的状态处理器","没有找到对应的状态处理器"),

    ORDER_NO_REPEAT(30000L, "订单号重复", "订单号重复"),
    ORDER_NO_EXIST(30001L, "订单号不存在", "订单号不存在"),


    ;

    public final Long code;
    public final String message;
    public final String data;

    CommonResultMessage(Long code,  String message, String data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static CommonResultMessage getResult(Long code) {
        for (CommonResultMessage resultMessage : CommonResultMessage.values()) {
            if (resultMessage.code.equals(code)) {
                return resultMessage;
            }
        }
        return null;
    }

    public Long getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    public String getData() {
        return data;
    }
}
